/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 采购单Entity
 *
 * @author HOHD
 * @version 2020-12-16
 */
@Table(name = "st_purchase_detail", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "id", isPK = true),
        @Column(name = "bill_no", attrName = "billNo", label = "单据号"),
        @Column(name = "material_name", attrName = "materialName", label = "物料名称", queryType = QueryType.LIKE),
        @Column(name = "number", attrName = "number", label = "数量"),
        @Column(name = "unit", attrName = "unit", label = "单位"),
        @Column(name = "single_price", attrName = "singlePrice", label = "单价"),
        @Column(name = "money", attrName = "money", label = "金额"),
        @Column(name = "tax_rate", attrName = "taxRate", label = "税率"),
        @Column(name = "delivery_date", attrName = "deliveryDate", label = "交货日期"),
        @Column(name = "num_now", attrName = "numNow", label = "现存数量"),
        @Column(name = "remarks", attrName = "remarks", label = "备注", queryType = QueryType.LIKE),
        @Column(name = "parent_id", attrName = "parentId.id", label = "父id"),
}, orderBy = "a.id ASC"
)
public class StPurchaseDetail extends DataEntity<StPurchaseDetail> {

    private static final long serialVersionUID = 1L;
    private String billNo;
    private String materialName;        // 物料名称

    private StMaterialRecord materialRecord;
    private Integer number;        // 数量
    private String unit;        // 单位
    private BigDecimal singlePrice;        // 单价
    private BigDecimal money;        // 金额
    private String taxRate;        // 税率
    private StTaxRateSetting stTaxRateSetting;
    private Date deliveryDate;        // 交货日期
    private Integer numNow;        // 现存数量
    private StPurchaseBill parentId;        // 父id 父类
    private StSupplierRecord supplier;//拉出来做主表用
    private StUnitSetting stUnitSetting;//做主表用

    private Integer hasIn;//已入
    private Integer hasOut;// 退货
    private Integer notIn;// 未入

    private String inNo;//入库单号
    private Date inDate;//入库日期

    private String groupDate;//分组年月

    private BigDecimal purchaseMoney;//采购金额
    private BigDecimal inWarehouseNumber;//入库金额

    public BigDecimal getPurchaseMoney() {
        return purchaseMoney;
    }

    public void setPurchaseMoney(BigDecimal purchaseMoney) {
        this.purchaseMoney = purchaseMoney;
    }

    public BigDecimal getInWarehouseNumber() {
        return inWarehouseNumber;
    }

    public void setInWarehouseNumber(BigDecimal inWarehouseNumber) {
        this.inWarehouseNumber = inWarehouseNumber;
    }

    public String getGroupDate() {
        return groupDate;
    }

    public void setGroupDate(String groupDate) {
        this.groupDate = groupDate;
    }

    public StTaxRateSetting getStTaxRateSetting() {
        return stTaxRateSetting;
    }

    public void setStTaxRateSetting(StTaxRateSetting stTaxRateSetting) {
        this.stTaxRateSetting = stTaxRateSetting;
    }

    public String getInNo() {
        return inNo;
    }

    public void setInNo(String inNo) {
        this.inNo = inNo;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getInDate() {
        return inDate;
    }

    public void setInDate(Date inDate) {
        this.inDate = inDate;
    }

    public Integer getHasIn() {
        return hasIn;
    }

    public void setHasIn(Integer hasIn) {
        this.hasIn = hasIn;
    }

    public Integer getHasOut() {
        return hasOut;
    }

    public void setHasOut(Integer hasOut) {
        this.hasOut = hasOut;
    }

    public Integer getNotIn() {
        return notIn;
    }

    public void setNotIn(Integer notIn) {
        this.notIn = notIn;
    }

    public StSupplierRecord getSupplier() {
        return supplier;
    }

    public void setSupplier(StSupplierRecord supplier) {
        this.supplier = supplier;
    }

    public StUnitSetting getStUnitSetting() {
        return stUnitSetting;
    }

    public void setStUnitSetting(StUnitSetting stUnitSetting) {
        this.stUnitSetting = stUnitSetting;
    }

    public StPurchaseDetail() {
        this(null);
    }


    public StPurchaseDetail(StPurchaseBill parentId) {
        this.parentId = parentId;
    }

    public StMaterialRecord getMaterialRecord() {
        return materialRecord;
    }

    public void setMaterialRecord(StMaterialRecord materialRecord) {
        this.materialRecord = materialRecord;
    }

    public String getBillNo() {
        return billNo;
    }

    public void setBillNo(String billNo) {
        this.billNo = billNo;
    }

    @Length(min = 0, max = 36, message = "物料名称长度不能超过 36 个字符")
    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    @Length(min = 0, max = 36, message = "单位长度不能超过 36 个字符")
    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public BigDecimal getSinglePrice() {
        return singlePrice;
    }

    public void setSinglePrice(BigDecimal singlePrice) {
        this.singlePrice = singlePrice;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    @Length(min = 0, max = 36, message = "税率长度不能超过 36 个字符")
    public String getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(String taxRate) {
        this.taxRate = taxRate;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public Integer getNumNow() {
        return numNow;
    }

    public void setNumNow(Integer numNow) {
        this.numNow = numNow;
    }

    @Length(min = 0, max = 36, message = "父id长度不能超过 36 个字符")
    public StPurchaseBill getParentId() {
        return parentId;
    }

    public void setParentId(StPurchaseBill parentId) {
        this.parentId = parentId;
    }

}